//
//  SpotEntity.m
//  DYS
//
//  Created by 房 国生 on 15/6/19.
//  Copyright (c) 2015年 lyss. All rights reserved.
//

#import "SpotEntity.h"

@implementation SpotEntity

- (instancetype)initWithAttributes:(NSDictionary *)attributes
{
    self = [super init];
    if (!self) {
        return nil;
    }
    
    self.ID= [attributes valueForKeyPath:@"id"];
    self.title = [attributes valueForKeyPath:@"title"];
    self.album = [NSString stringWithFormat:@"%@/%@", IMAGE_URL, [attributes valueForKeyPath:@"album"]];
    self.audio = [NSString stringWithFormat:@"%@/%@", IMAGE_URL, [attributes valueForKeyPath:@"audio"]];//[attributes valueForKeyPath:@"audio"]
    self.content = [attributes valueForKeyPath:@"content"];
    self.images = [attributes valueForKeyPath:@"images"];
    self.ptype = [attributes valueForKeyPath:@"ptype"];
    self.x = [attributes valueForKeyPath:@"x"];
    self.y = [attributes valueForKeyPath:@"y"];
    self.latitude = [attributes valueForKeyPath:@"latitude"];
    self.longitude = [attributes valueForKeyPath:@"longitude"];
    self.album1 = [NSString stringWithFormat:@"%@/%@", IMAGE_URL, [attributes valueForKeyPath:@"album1"]];
    self.is_recommend = [attributes valueForKey:@"is_recommend"];
    self.radius = [attributes valueForKeyPath:@"radius"];
    self.business_id = [attributes valueForKeyPath:@"business_id"];
    return self;
}

@end
